/*
 * Copyright (c) 2025 Industrial Software Feature Database
 */
package com.comac.ins.common.biz.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 *
 * 业务事件状态
 * @author zhanghongyi
 * @date 2024/7/5 14:07
 * @description BizEventStatusEnum
 */
@Getter
@AllArgsConstructor
public enum BizEventStatusEnum {
    /**
     * INIT
     */
    INIT("INIT", "初始化"),
    DOING("DOING","进行中"),
    DONE("DONE","完成"),
    FAIL("FAIL","失败"),
    NONE_MATCH("NONE_MATCH","无匹配"),
    ;
    private final String code;
    private final String desc;

    public static BizEventStatusEnum getByCode(String code) {
        for (BizEventStatusEnum value : values()) {
            if (StringUtils.equals(value.code, code)) {
                return value;
            }
        }
        return null;
    }
}
